Plotting domains of functions

For multivariate functions such as \(f(x,y)\), there may some values of x and y that don’t produce outputs. For example for \(f(x,y) = y\ln(x)\) we cannot put x values for \(x\leq 0\). To understand the behaviour of the function, it is good to know which values of x$$ and \(y\)’s are valid for \(f(x,y)\) or namely what is the domain of \(f(x,y)\).

Before we start

It is worth to know common lines before we start to sketch the domains of functions. You can put different pairs of x,y to test whether they hold:

\(y = x\ and\ y = -x\)

\(y = x - 1\ and\ y = x + 1\)

$y = x^2  and  y^2 = x $

Important

Don’t get confused with \(y^2 = x \Rightarrow y = \sqrt{x}\). We lose some values of x when taking the root of x. So for the first equation there are negative and positive values of y that holds the equation while for the second there is only positive values of y:

$y = x^2 + 1  and y^2 + 1 = x $

Exercises - Part 1

Find and sketch the domain of the following functions

Exercise 1: \(\ \ f(x,y) = \sqrt{x+y}\)

Solution: Since \(\sqrt{\ \ }\) function is not defined for negative inputs, our domain is $ x+y > 0$, or $ x > -y $, or $ y < -x $

The sketch: To sketch this function:

  1. We will first start with plotting \(y = -x\), then shade the region of our domain. The y = -x function is the symmetric of y = x, for every value of x, you will get y=-x, i.e. for x=[-3,2,-1,0,1,2], y=[3,2,1,0,-1,-2]
  2. Then we will determine which side of the line is our domain:

We shaded the left area because all values of \(y\) that is less than \(-x\) are in our domain; e.g. for (x,y) pairs, (1,-2), (1,-3) etc.

Another way to imagine which part to shade is to remember that \(y = -x -1, y= -x-2\) etc. are all \(y < -x\). This is the left part.

Exercise 2: \(\ \ f(x,y) = \ln(9-x^2-9y^2)\)

Since input of an ln function cannot be 0 or negative we have:

\[x^2 + 9y^2 < 9\]

which is a formula of an ellipse. To sketch this formula we will first take \(x^2 + 9y^2 = 9\), later find the extreme points by setting \(y = 0\) and then \(x = 0\) as follows:

  1. For \(y = 0\), we have \(x^2 = 9\). Thus \[ y=0 \Rightarrow x=\{-3,3\}\]
  2. For \(x = 0\), we have \(9y^2 = 9\). Thus \[ x=0 \Rightarrow y=\{-1,1\}\]

So we now detected 4 extreme points for our sketch:

## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.

We know that this is a formula of an ellipse but on the other hand it is obvious that the lines connecting these points are quadratic (curvy). By connecting these lines we can sketch \(x^2 + 9y^2 = 9\).

Next we will determine whether interior or exterior of our ellipse is our domain. It is obvious that for \(x^2 + 9y^2 = k\), k<9, we will have a narrower ellipse. Hence our domain is the interior of the ellipse:

## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.

Exercise 3: $ f(x,y) = - $

Since input of a function cannot be less than 0 we have $1-x^2 > 0 1-y^2 >0 $ or:

\[x^2 < 1 \text{ and } y^2 < 1 \]

We have two distinct interval, in other words x and y doesn’t have a joint condition. So our conditions are:

  1. \(x \in (-1,1)\) and
  2. $ y (-1,1) $

So our domain sketch would be

## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.

Exercise 4: $ f(x,y) = + $

Since input of a function cannot less than 0 we have the following conditions:

  1. \(y \geq 0\) and
  2. \(x^2 + y^2 \leq 1\)
  • Our first condition is easy to plot; regardless of the value of x (ignoring its relation with the second condition for now), y must be greater than or equal to 0
  • Our second condition is very similar to Exercise 2. Here instead of an ellipse we have a circle. Thus
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.

So the intersection of these two regions is:

## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.

Exercises - Part 2

Sketch the graph of the following functions:

Exercise 5: \(f(x,y) = 10 - 4x - 5y\)

Before sketching it is best to understand general behaviour of the function. It can be seen that this function is not bounded, so for any value of k, $f(x,y) = k = 10 - 4x - 5y $, the function is defined. It is a general form of a plane, \(ax+by+c\).

To sketch a plane we start with rewriting formula in form of \(4x+5y+z=10\). By setting each variable to 0 one by one we can draw the graph

  1. For \(x=0\), we have \(z=10-5y\):

For this case when y=0, z=10; when z=0, y= 2. So it is the line passes through (0,2,0) and (0,0,10) for (x,y,z).

  1. For \(y=0\), we have \(z=10-4y\)

For this case when x=0, z=10; when z=0, x= 2.5. So it is the line passes through (2.5,0,0) and (0,0,10) for (x,y,z).

  1. For \(z=0\), we have \(y=2-\frac45x\)

For this case when y=0, x=2.5; when x=0, y= 2. So it is the line passes through (0,2,0) and (2.5,0) for (x,y,z).

We have drawn edges of our surface. The region inside satisfies the function $10 - 4x - 5y $ for different x,y pairs. Thus our surface is:

Exercise 6: \(f(x,y) = \sqrt{16-x^2 - 16y^2}\)

Before sketching this function it is best to guess what the outcome is. Here the output of the function \(z\) cannot be negative because of the \(\sqrt{\ }\) term and the maximum value of z can be 4. Besides we have a function of \(x^2+16y^2=16-z^2\) for \(z \in [0,4]\), so for each value of \(z\) we will have \(x^2+16y^2=k\) which is an ellipse. By combining the two observations we can see that the surface would be a half ellipsoid. We begin by finding bounds of our surface

  1. For \(y=0\), we have $x^2 + z^2=16. Since we know that we don’t have negative values for \(z\), this is a half circle.

  2. For \(x=0\), we have \(16y^2 + z^2=16\). Since we know that we don’t have negative values for \(z\), this is a half ellipse.

  3. For \(z=0\), we have \(x^2+16y^2=16\). This is a formula of an ellipse.

  4. Moreover for z=4, we have x=y=0. So by combining these one by one we can sketch:

We have drawn edges of our surface. The region inside satisfies the function $sqrt{16-x2-16y2} $ for different x,y pairs. Thus our surface is:

Exercise 7: $f(x,y) = $

Before sketching this function it is best to guess what the outcome is because writing the function in form of \(z^2=x^2+y^2\) is not going to help us a lot. To begin with, the output of the function \(z\) cannot be negative because of the \(\sqrt{\ }\) term and \(z \in [0,\infty)\). As in previous examples, we will set x and y to 0 and plot some bounds to our surface. But for \(z=0\), we have x=y=0. So here we will imagine different (arbitrary) values of z and the corresponding x,y lines/curves for these values:

  1. For \(y=0\), we have $z^2 = y^2 z = .

  2. For \(x=0\), we have $z^2 = y^2 z = .

  3. For \(z=0\), x=y=0.

  4. For \(z=1\), we have \(x^2+y^2=1\), a circle with radius 1. (In your plots you don’t have to plot this. We write here to make it easier to grasp)

  5. For \(z=4\), we have \(x^2+y^2=16\), a circle with radius 4. So by combining these one by one we can sketch:

We have drawn the sketch of our surface. By filling the region we have: